//两数之和 力扣1
//哈希表 判断一个元素是否遍历过
class Solution {
public:
	vector<int> twoSum(vector<int>& nums, int target) {
		unordered_map<int,int> a;
		for(int i = 0; i <= nums.size(); i++)
		{
			auto it = a.find(target-nums[i]);
			if(it != a.end())
			{
				return {i,it->second};
			}
			a.insert(pair<int,int>(nums[i],i));
			
		}
		return {};
	}
};
